from core.object import AccountData, OrderData, PositionData


def base_from_dict(trade_server_dc: dict):
    order_dc: dict[OrderData] = trade_server_dc["order_dc"]
    position_dc: dict[PositionData] = trade_server_dc["position_dc"]
    account: AccountData = trade_server_dc["account"]

    return order_dc, position_dc, account


def dict_from_base(order_dc: dict[str, OrderData], position_dc: dict[str, PositionData], account: AccountData):
    trade_server_dc = {"order_dc": order_dc, "position_dc": position_dc, "account": account}

    return trade_server_dc


